import { defineAsyncComponent } from 'vue'
import { createWebHistory, createRouter } from 'vue-router'

export const routes = [
	{
		name: 'Home',
		path: '/home',
		meta: { title: '首页' },
		component: defineAsyncComponent(() => import('../views/Home')),
	},
	{
		name: 'About',
		path: '/about',
		meta: { title: '关于' },
		component: defineAsyncComponent(() => import('../views/About')),
	},
	{
		path: '',
		redirect: '/home',
		hidden: true,
	},
]

export default createRouter({
	history: createWebHistory(),
	routes,
})
